<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增项目立项')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-project-add">
        	<div class="form-group">    
                <label class="col-sm-3 control-label is-required">项目名称(与合同一致)：</label>
                <div class="col-sm-8">
                    <input name="name" class="form-control" autoComplete="off" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">单位名称：</label>
                <div class="col-sm-8">
                    <select id="customerName" name="customerName" class="form-control" required>
                    	<option value=""></option>
						<option th:each="cl:${clis}" th:value="${cl.name}" th:text="${cl.name}"></option>
					</select>
                </div>
            </div>
<!--             <div class="form-group">     -->
<!--                 <label class="col-sm-3 control-label ">项目框架协议：</label> -->
<!--                 <div class="col-sm-8"> -->
<!--                     <select id="groupName" name="groupName" class="form-control" > -->
<!--                     	<option value=""></option> -->
<!-- 						<option th:each="gl:${glis}" th:value="${gl.name}" th:text="${gl.name}"></option> -->
<!-- 					</select> -->
<!--                 </div> -->
<!--             </div> -->
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">合同总金额：</label>
                <div class="col-sm-8">
                    <input name="zongje" class="form-control" autoComplete="off" type="text" required>
                </div>
            </div>
<!--             <div class="form-group"> -->
<!--                 <label class="col-sm-3 control-label is-required">项目描述：</label> -->
<!--                 <div class="col-sm-8"> -->
<!--                     <textarea name="descs" class="form-control" required></textarea> -->
<!--                 </div> -->
<!--             </div> -->
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
    	var icon = "<i class='fa fa-times-circle'></i> ";
        var prefix = ctx + "gcgl/project"
        $("#form-project-add").validate({
            focusCleanup: true,
            rules: {
            	zongje: {
                    required: true,
                    range:[1,1000000000]
                },
            },
            messages: {
            	zongje: {
                    required: icon+"必填",
                    range: icon+"合同金额必须输入1,1000000000之间的数。"
                }
            }
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-project-add').serialize());
            }
        }
    </script>
</body>
</html>